package com.java复习.IO流;


import java.io.FileReader;
import java.io.FileWriter;

public class 字符流 {
    public static void main(String[] args) throws Exception {
        FileReader fis = new FileReader("D:\\Desktop\\a.txt");
        FileWriter fos = new FileWriter("D:\\Desktop\\c.txt");

        char[] c = new char[1024];

        int lengh = 0;
        // 边读取边写入
        while ((lengh = fis.read(c)) != -1){
            fos.write(c,0,lengh);
        }

        fos.close();  // 后开启的先关闭
        fis.close();
    }
}
